package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.entity.Dept;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface DeptMapper {
@Select("select * from dept")
    List<Dept> selectAll();
@Delete("delete from dept where id = #{id}")
    void deleteById(Integer id);
@Insert("INSERT INTO dept(NAME, CREATE_TIME, UPDATE_TIME) VALUE (#{name},#{createTime},#{updateTime})")
    void insertDept(Dept dept);
@Select("select * from dept where id = #{id}")
    Dept selectById(Integer id);
//@Update("update dept set name = #{name},UPDATE_TIME = #{updateTime} where id = #{id} ")
    void updateDept(Dept dept);
}
